/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import java.util.Set;
import java.util.TreeSet;

/**
 * <p>Project: jse2303 - TreeSet1
 * <p>Powered by webrx On 2023-07-19 17:28:07
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class TreeSet2 {
    public static void main(String[] args) {
        //Set<String> sm = new TreeSet<>();
        //sm.add(new String("java"));
        //sm.add(new String("c"));
        //sm.add(new String("c++"));
        //sm.add(new String("c++"));
        //sm.add(new String("c++"));
        //System.out.println(sm.size());
        //System.out.println(sm);

        Set<Member> ss = new TreeSet<>((a, b) -> b.getId() - a.getId());
        ss.add(new Member(12, "张丽"));
        ss.add(new Member(10, "李四"));
        ss.add(new Member(15, "张三丰"));
        ss.add(new Member(6, "赵勇"));
        ss.add(new Member(25, "张三"));
        System.out.println(ss);
        System.out.println(ss.size());
    }
}
